package com.xplay.xpocker.exception;

public class ServiceRuntimeException extends RuntimeException {
    private static final long serialVersionUID = 1135733997800022809L;

    private String message;
    private String code = StatusCodeEnum.RUN_TIME_EXCEPTION.getCode();

    public ServiceRuntimeException(String message) {
        this.message = message;

    }

    public ServiceRuntimeException(String message, Object... params) {
        this.message = String.format(message, params);;

    }


    public ServiceRuntimeException(StatusCodeEnum status, Object... params) {
        this.message = String.format(status.getDesc(), params);
        this.code = status.getCode();
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
